feat(merkle_bridge): integrate carbon_asset minting cross-contract call (#521) - #585
Closed
Francis6-git wants to merge 6 commits into
Closed
Conversation
|
@Francis6-git Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
@Francis6-git who authorize you to modify a workflow file. I will not merge this PR until you go and copy the exact workflow file from our main branch and delete your local version of it; pasting our version there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR completes the deferred cross-contract integration between
merkle_bridgeandcarbon_asset. Previously,mint_wrappedperformed Merkle proof verification but only incremented an isolated local counter instead of minting actual tokens oncarbon_asset.With this change,
mint_wrappedconsumes the configuredCarbonAssetContractaddress, executes a guarded cross-contract mint call, and persists/emits the real canonical token ID returned bycarbon_asset.Changes Made
carbon_asset.wasmintomerkle_bridge/src/lib.rsviacontractimport!.MerkleBridgeError::MintFailed(code10) to handle trapped or non-success cross-contract calls safely.mint_wrappedto fetch the configured address usingget_carbon_asset_contract.NextTokenIdgeneration withenv.try_invoke_contractcallingcarbon_asset::mint.MerkleBridgeError::MintFailed.CreditBridgedEventand local storage mappings to record the canonicaltoken_idreturned bycarbon_asset. Addedget_token_idhelper.CarbonAssetNotSetconfiguration, and cross-contractMintFailederrors.build-carbon-asset-wasm.ps1helper script for fixture builds.Verification
cargo testinstellar-core/verifiable-registry/contracts/merkle_bridge/to verify all proof verification, error mapping, and contract integration tests pass.carbon_asset.Closes #521